package utils.global.constant;

import lombok.AllArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

@AllArgsConstructor
@ToString
public enum RestfulType implements Serializable {

    OPERATION__SUCCESS("操作成功", 1),
    OPERATION__FAILURE("操作成功", -1),

    GET_SUCCESS("获取成功", 21),
    GET_FAILURE("获取失败", -21),

    SET_SUCCESS("设置成功", 31),
    SET_FAILURE("设置失败", -31),

    AUTH_SUCCESS("校验通过", 41),
    AUTH_FAILURE("校验异常", -41),

    FLOW_SUCCESS("通过流量", 51),
    FLOW_AILURE("流量限制", -51),

    ERROR("系统异常", 500);

    private String description;
    private Integer code;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
